package com.example.design.behavior.observer;

import java.util.Observable;

/**
 * \* @author: bear
 * \* Date: 2021-01-26-16:03
 * \* describe: 被观察者
 */
public class News extends Observable {
	private String title;
	private String content;

	public News(String title, String content) {
		this.title = title;
		this.content = content;
	}
	public String getTitle() {
		return title;
	}
	public String getContent() {
		return content;
	}
	public void content(Reader reader){
		//收获留言
		System.out.println("读者来信: "+reader.getReaderName());
		setChanged();
		notifyObservers(reader);
	}
}
